package com.jj.spb.spring_boot_mybatis.repository;

import com.jj.spb.spring_boot_mybatis.entity.VoteItem;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Optional;

@Repository
public interface VoteItemRepository extends JpaRepository<VoteItem,Integer> {

    boolean existsByVoteIdAndSerialNum(long voteId,int serialNum);

    int findIdByVoteIdAndSerialNum(long voteId,int serialNum);

    Optional<List<VoteItem>> findAllByVoteId(long voteId);
}
